package com.sxhuayuan.parking.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 * 停车场用户，包含临时/永久/包年/包月等
 * 
 * @author gy
 */
@Entity
@Table(name = "hypk_car_plate", indexes = { @Index(columnList = "carPlate") })
public class CarPlate extends BaseEntity {

	private static final long serialVersionUID = 4511325530278279489L;

	private String carPlate;

	private Type type;

	private Long parkingLotId;

	// 有效期
	private Date beginTime;

	private Date endTime;

	@NotNull
	@Column(nullable = false)
	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	@NotNull
	@Column(length = 32)
	public String getCarPlate() {
		return carPlate;
	}

	public void setCarPlate(String carPlate) {
		this.carPlate = carPlate;
	}

	@NotNull
	@Column(nullable = false)
	public Long getParkingLotId() {
		return parkingLotId;
	}

	public void setParkingLotId(Long parkingLotId) {
		this.parkingLotId = parkingLotId;
	}

	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	/** 类型 */
	public enum Type {

		/** 长期 */
		longterm,
		/** 包年 */
		year,
		/** 年月 */
		month,
		/** 短期 */
		temp
	}

}
